import React, { } from 'react'
import { View, Image } from '@tarojs/components'
import Container from '../Container'
import { AtIcon } from 'taro-ui'
import Router from '@/utils/router';
import "taro-ui/dist/style/components/icon.scss";
import './index.scss'
const Search = (props) => {
    const { data = {} } = props
    const {
        title,
        radiusType,
        position,
        fontColor,
        iconColor,
        searchColor,
        borderRadius
    } = data
    return <Container {...props}>
        <View onClick={() => {
            Router('searchList')
        }} style={{ background: searchColor, justifyContent: position, borderRadius: radiusType === 'rightAngle' ? 'none' : borderRadius }} className='Search_box'>
            {
                position === 'space-between' ? <>
                    <View style={{ paddingLeft: '12px', color: fontColor }}>
                        {title}
                    </View>
                    <View style={{ paddingRight: '12px', color: iconColor }}>
                        <AtIcon value='search' size='24'></AtIcon>

                    </View>

                </> : <>
                    <View style={{ paddingLeft: '12px', color: iconColor }}>
                        <AtIcon value='search' size='24'></AtIcon>
                    </View>
                    <View style={{ paddingLeft: '12px', color: fontColor }}>
                        {title}
                    </View>
                </>
            }
        </View>
    </Container>
}
export default Search